Option Strict On
Option Explicit On
Friend Class clsPaciente
	Implements _IEntidad
	
	Private MyOID As clsOID
	Private MyCategoria As String
	Private MyNombre As String
	Private MyApellido As String
	Private MyNroDoc As String
	Private MyTipoDoc As String
	Private MyEstadoCivil As String
	Private MySexo As String
	Private MyIDObraSocial As String
	Private MyObraSocial As clsObraSocial
	Private MyNroAfiliadoOS As String
	Private MyNroHistoriaClinica As String
	Private MyTelefono As String
	Private MyCelular As String
	Private MyFechaNac As Date
	Private MyDomicilio As String
	Private MyProvincia As String
	Private MyLocalidad As String
	Private MyCodigoPostal As String
	Private MyNroHistoriaClinicaValido As Boolean
	
	
	Private Property IEntidad_OID() As clsOID Implements _IEntidad.OID
		Get
            Return MyOID
		End Get
		Set(ByVal Value As clsOID)
			MyOID = Value
		End Set
	End Property
	
	
	Public Property Nombre() As String
		Get
            Return MyNombre
		End Get
		Set(ByVal Value As String)
			MyNombre = Value
		End Set
	End Property
	
	
	Public Property Apellido() As String
		Get
            Return MyApellido
		End Get
		Set(ByVal Value As String)
			MyApellido = Value
		End Set
	End Property
	
	
	Public Property TipoDoc() As String
		Get
            Return MyTipoDoc
		End Get
		Set(ByVal Value As String)
			MyTipoDoc = Value
		End Set
	End Property
	
	
	Public Property NroDoc() As String
		Get
            Return MyNroDoc
		End Get
		Set(ByVal Value As String)
			MyNroDoc = Value
		End Set
	End Property
	
	
	Public Property EstadoCivil() As String
		Get
            Return MyEstadoCivil
		End Get
		Set(ByVal Value As String)
			MyEstadoCivil = Value
		End Set
	End Property
	
	
	Public Property Sexo() As String
		Get
            Return MySexo
		End Get
		Set(ByVal Value As String)
			MySexo = Value
		End Set
	End Property
	
	
	Public Property IDObraSocial() As String
		Get
            Return MyIDObraSocial
		End Get
		Set(ByVal Value As String)
			MyIDObraSocial = Value
		End Set
	End Property
	
	
	Public Property ObraSocial() As clsObraSocial
		Get
            Return MyObraSocial
		End Get
		Set(ByVal Value As clsObraSocial)
			Dim Ent As _IEntidad
			MyObraSocial = Value
			If Value Is Nothing Then
				IDObraSocial = "1"
			Else
				Ent = Value
				IDObraSocial = Ent.OID.ID
			End If
		End Set
	End Property
	
	
	Public Property NroAfiliadoOS() As String
		Get
            Return MyNroAfiliadoOS
		End Get
		Set(ByVal Value As String)
			MyNroAfiliadoOS = Value
		End Set
	End Property
	
	
	Public Property NroHistoriaClinicaValido() As Boolean
		Get
            Return MyNroHistoriaClinicaValido
		End Get
		Set(ByVal Value As Boolean)
			MyNroHistoriaClinicaValido = Value
		End Set
	End Property
	
	
	Public Property NroHistoriaClinica() As String
		Get
			Dim strNroHC As String
			If Not NroHistoriaClinicaValido Then ' significa que el nro de Historia clinica hay que modificarlo
				strNroHC = MyNroHistoriaClinica
                Return MyNroHistoriaClinica
                If Len(strNroHC) > 1 Then Return Right(strNroHC, Len(strNroHC) - 1)
			Else
                Return MyNroHistoriaClinica
			End If
		End Get
		Set(ByVal Value As String)
			NroHistoriaClinicaValido = IsNumeric(Value)
			MyNroHistoriaClinica = Value
		End Set
	End Property
	
	
	Public Property Telefono() As String
		Get
            Return MyTelefono
		End Get
		Set(ByVal Value As String)
			MyTelefono = Value
		End Set
	End Property
	
	
	Public Property Celular() As String
		Get
            Return MyCelular
		End Get
		Set(ByVal Value As String)
			MyCelular = Value
		End Set
	End Property
	
	
	Public Property FechaNac() As Date
		Get
            Return MyFechaNac
		End Get
		Set(ByVal Value As Date)
			MyFechaNac = Value
		End Set
	End Property
	
	
	Public Property Domicilio() As String
		Get
            Return MyDomicilio
		End Get
		Set(ByVal Value As String)
			MyDomicilio = Value
		End Set
	End Property
	
	
	Public Property Provincia() As String
		Get
            Return MyProvincia
		End Get
		Set(ByVal Value As String)
			MyProvincia = Value
		End Set
	End Property
	
	
	Public Property Localidad() As String
		Get
            Return MyLocalidad
		End Get
		Set(ByVal Value As String)
			MyLocalidad = Value
		End Set
	End Property
	
	
	Public Property CodigoPostal() As String
		Get
            Return MyCodigoPostal
		End Get
		Set(ByVal Value As String)
			MyCodigoPostal = Value
		End Set
	End Property
	
	Public Sub Constructor(ByRef MyClave As String)
		MyOID = NewOID(MyClave, tipoPACIENTE)
	End Sub
End Class